<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<style>
		.table th, .table td {
			line-height: 20px;
			text-align: center;
			border-top: 1px solid #efefef;
			padding: 5px 0 5px 10px;
			vertical-align: middle;
		}

		.table thead th {
			vertical-align: bottom;
			line-height: 40px;
		}
	</style>
</head>
<body>
<div id="content">
	<include file="Public/maintop"/>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="cyz-m-tab">
						<ul class="cyz-m-tab-title">
							<li class="cyz-m-this" href="javascript:void(0);">会员管理</li>
						</ul>
					</div>

					<div class="widget-content" style="padding:5px;border:0px;">
						<form action="__ACTION__" method="get">
							<div class="fr table-button">
								<button type="submit" class="btn btn-success"><i class="icon-search"></i> 搜索</button>
							</div>
							<div class="fr table-button">
								<select name="user_type" style="width:150px;">
									<option value="0">会员类型</option>
									<option value="1"
									<if condition="$Think.get.user_type == '1'">selected</if>
									>VIP会员</option>
									<option value="-1"
									<if condition="$Think.get.user_type == '-1'">selected</if>
									>普通会员</option>
								</select>
								<input type="text" name="name" placeholder="请输入昵称/手机号码" value="{#$Think.get.name}">
							</div>
						</form>
					</div>

					<div class="widget-content" style="padding:0px;">
						<table class="table table-striped">
							<thead>
							<tr>
								<th style="width:80px;">ID</th>
								<th style="width:250px;">用户信息</th>
								<th style="width:250px;">推荐人信息</th>
								<th style="width:120px;">会员类型</th>
								<th style="width:180px;">注册时间</th>
								<!--								<th style="width:280px;">操作</th>-->
							</tr>
							</thead>
							<tbody>
							<notempty name="list">
								<volist name="list" id="article">
									<tr>
										<td>{#$article.id}</td>
										<td style="text-align: left;">
											<div rel="pop" style="display: flex">
												<img style="width: 40px;height: 40px;border-radius: 50%;border:1px solid #efefef;" src="{#$article.user_headimg}">
												<span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
								   <span class="nickname">
									   {#$article.user_nickname}<br>
									   手机号码：{#$article.user_true_phone}<br>
								   </span>
							</span>
											</div>
										</td>
										<td style="text-align: left;">
											<if condition="$article['referrer_user_id'] gt 0">
												<div rel="pop" style="display: flex">
													<img style="width: 40px;height: 40px;border-radius: 50%;border:1px solid #efefef;" src="{#$article.referee_user_headimg}">
													<span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
								   <span class="nickname">
									   {#$article.referee_user_nickname}<br>
									   手机号码：{#$article.referee_user_true_phone}<br>
								   </span>
							</span>
												</div>
												<else/>
												--
											</if>
										</td>
										<td>
											<eq name="article.is_vip" value="0">
												<span class="btn btn-mini">普通会员</span>
											</eq>
											<eq name="article.is_vip" value="1">
												<span class="btn btn-warning btn-mini">VIP会员</span>
											</eq>
										</td>
										<td>{#$article.add_time|time_format}</td>
										<!--										<td>-->
										<!--											<a href="javascript:void(0);" data-title="会员详情" data-url="{#$article.a_userinfo}" data-width="800px" data-height="80%" class="btn btn-mini btn-success layer-open-btn">详情</a>-->
										<!--										</td>-->
									</tr>
								</volist>
								<else/>
								<td colspan="8" class="text-center"> 暂时还没有信息!</td>
							</notempty>
							</tbody>
						</table>
						<div id="hongxin_page_view">{#$list_data._page}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.ui.custom.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.uniform.js"></script>
<script src="__JS__/select2.min.js"></script>
<script src="__JS__/matrix.js"></script>
<script src="__JS__/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/Admin/js/common.js"></script>
<script>
function dodel(jump_url) {
	layer.confirm('确定要删除吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		window.location.href = jump_url;
		layer.close(e);
	}, function(e) {
		layer.close(e);
	});
}

function delUserType(jump_url) {
	layer.confirm('确定要删除该会员类型吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		window.location.href = jump_url;
		layer.close(e);
	}, function(e) {
		layer.close(e);
	});
}

function changstatus(field, status, aid, e) {
	var loadi = null;
	loadi = layer.load(2);
	$.ajax({
		type: "GET",
		url: "__CONTROLLER__/setstatus",
		data: {c_field: field, c_value: status, id: aid},
		dataType: "html",
		success: function(data) {
			layer.close(loadi);
			$(e).parent("td").html(data);
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {

		}
	});
}

function bindUserYewuyuan(url) {
	layer.open({
		type: 2,
		offset: '100px',
		title: '设为运营人员',
		area: ['500px', '400px'],
		content: url,
		success: function(layero, index) {

		}
	});
}

function cacelUserYewuyuan(user_id, title) {
	layer.confirm('确定' + title + '吗', {
		title: '提示',
		icon: 0,
		btn: ['确定', '取消'] //按钮
	}, function(e) {
		layer.close(e);
		var loadingIndex = layer.load(2);
		$.ajax({
			type: "GET",
			data: {user_id: user_id, _: Date.now()},
			dataType: "json",
			url: "{#:U('cacelUserType')}",
			success: function(data) {
				layer.close(loadingIndex);
				if (data.status == 1) {
					layer.alert(data.msg, {icon: 1}, function() {
						window.location.reload();
					});
				} else {
					layer.alert(data.msg, {icon: 0});
				}
			}
		})
	}, function(e) {
		layer.close(e);
	});
}
</script>
</body>
</html>
